import java.util.Scanner;

public class DAY0412 {
    public static void main1(String[] args) {
        long[] num=new long[91];
        num[0]=1;
        num[1]=1;
        for (int i = 2; i < 91 ; ++i) {
            num[i]=num[i-1]+num[i-2];
        }
        Scanner sc=new Scanner(System.in);
        while (sc.hasNext()){
            int n=sc.nextInt();
            System.out.println(num[n]);
        }
    }

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while (sc.hasNext()){
            int n=sc.nextInt();
            sc.nextLine();//吃掉回车
            //接收n个收件人名字
            for (int i = 0; i < n; i++) {
                String name=sc.nextLine();
                //如果名字里面有，或者  则输出加上双引号的名字
                if(name.contains(",")||name.contains(" ")){
                    System.out.print("\""+name+"\"");//打印出双引号必须要用转义字符
                }
                else
                    System.out.print(name);

                if(i==n-1){
                    System.out.println();//最后一个名字
                }else {
                    System.out.print(", ");
                }
            }
        }
    }
}
